{% if not is_pjax %}
  {% extends "../../layout/layout.html" %}
{% endif %}
{% block page_content %}
<ol class="breadcrumb">
  <li>
    <a data-pjax href="/admin/index">Home</a>
  </li>
  <li>
    <a data-pjax href="/admin/user/list">用户</a>
  </li>
  <li class="active">编辑</li>
</ol>

<div class="row">
  <div class="col-xs-12 col-sm-3 col-md-3 col-lg-3">
    {% set currentMenu = 'user' %}
    {% include "../admin_menu.html" %}
  </div>
  <div class="col-xs-12 col-sm-9 col-md-9 col-lg-9">
    <div class="panel panel-default">
      <div class="panel-heading">
        <h3 class="panel-title">更新用户</h3>
      </div>
      <div class="panel-body">
        <form action="/admin/user/edit" method="POST" role="form">
          <input type="hidden" name="id" value="{{user.id}}">
          <div class="form-group">
            <label for="username">用户名</label>
            <input type="text" class="form-control" id="username" name="username" value="{{user.username}}" placeholder="用户名">
          </div>
          <div class="form-group">
            <label for="password">密码</label>
            <input type="text" class="form-control" id="password" name="password" placeholder="密码,为空不修改">
          </div>
          <div class="form-group">
            <label for="department">部门</label>
            <select name="departmentId" id="departmentId" class="form-control">
              <option value="">请选择部门</option>
              {% for item in departments %}
                <option value="{{item.id}}" {% if user.department.name === item.name %} selected {% endif %}>{{item.name}}</option>
              {% endfor %}
            </select>
          </div>
          <button type="submit" class="btn btn-sm btn-primary">更新</button>
        </form>
      </div>
    </div>
  </div>
</div>

{% endblock %}
{% block page_js %}

{% endblock %}